<?php

namespace App\Http\Controllers;

use App\User;

class UserController extends Controller
{
    public function login(User $user)
    {
        $username = rq('username');
        $password = rq('password');

        $u = $user->where('username', $username)->first();
        if (!$u->pasword == $password) {
            return "password not correct";
        }
        //
        session()->put('account', $username);
        return "登陆成功";
    }
}
